package cn.gd.service.LeaveApplicationService;


import cn.gd.mapper.LeaveApplicationMapper.LeaveApplicationMapper;
import cn.gd.pojo.LeaveAppLiCations;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LeaveApplicationServiceImpl implements LeaveApplicationService {

    private final LeaveApplicationMapper leaveApplicationMapper;

    public LeaveApplicationServiceImpl(LeaveApplicationMapper leaveApplicationMapper) {
        this.leaveApplicationMapper = leaveApplicationMapper;
    }

    @Override
    public List<LeaveAppLiCations> findAll() {
        return leaveApplicationMapper.findAll();
    }

    @Override
    public LeaveAppLiCations findById(Integer applicationId) {
        return leaveApplicationMapper.findById(applicationId);
    }

    @Override
    public LeaveAppLiCations save(LeaveAppLiCations leaveApplication) {
        leaveApplicationMapper.insert(leaveApplication);
        return leaveApplication;
    }

    @Override
    public LeaveAppLiCations update(LeaveAppLiCations leaveApplication) {
        leaveApplicationMapper.update(leaveApplication);
        return leaveApplication;
    }

    @Override
    public void deleteById(Integer applicationId) {
        leaveApplicationMapper.deleteById(applicationId);
    }

    @Override
    public List<LeaveAppLiCations> getApprover(Integer applicationId) {
        return List.of();
    }
}
